<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <script type="text/javascript">
        function on_panel_close(){
          $("#imp_dept_panel").panel("destroy");
        }
    	$(document).ready(function(){
    	  $('#impresult').datagrid();
    	  $('#save').click(function (){
    	    $('#imp_dept_form').form('submit', {
    		  url: 'impDept.action',error:function(message){
    		    alert('提交数据错误，服务器可能已关闭！系统返回:'+message);
    		  },
    		  success:function(data){
     		    var a = eval('(' + data + ')');
    		    $.messager.alert('导入机构', a.message, 'info');
    		    
    		    $('#impresult').datagrid('loadData', a.detail);
    		  }
    	    })
    	  });
    	
    	  $('#imp_dept_panel').panel({onClose:on_panel_close});
     		$('#cancel').click(function (){
     			$('#imp_dept_panel').panel('close');
    		});
    	  });
    </script>
	</head>
	<body>

    <div id="imp_dept_panel" fit="true" title="机构导入" 
    	resizable="false" collapsible="false" minimizable="false" maximizable="false" 
    	closable="true" icon="icon-save" class="jquery_panel">
    	<s:form id="imp_dept_form" action="impDept" cssStyle="margin:5px,40px"
    		enctype="multipart/form-data">
    		<table>
    			<tr><td>说明：Excel文件必须为以下格式：</td></tr>
    			<tr><td>
    				<table cellspacing="1" cellpadding="1" bgcolor="#99BBE8" width="700">
    					<tr align="center" bgcolor="#CCCCCC" height="20"><td>A</td><td>B</td><td>C</td>
    						<td>D</td><td>E</td><td>F</td></tr>
    					<tr align="center" bgcolor="#FFFFFF" height="20"><td>机构号</td><td>机构名</td>
    						<td>机构类型</td><td>地址</td><td>电话</td><td>上级机构号</td></tr>
    					<tr align="center" bgcolor="#FFFFFF" height="20"><td>0001</td><td>河北银行</td>
    						<td>总行</td><td>石家庄市</td><td>03118862738</td><td>0001</td></tr>
    					<tr align="center" bgcolor="#FFFFFF" height="20"><td>0002</td><td>河北银行营业部</td>
    						<td>分行</td><td>石家庄市</td><td>031180001001</td><td>0001</td></tr>
    					<tr align="center" bgcolor="#FFFFFF" height="20"><td>0002</td><td>支行一</td>
    						<td>支行</td><td>石家庄市</td><td>031180001001</td><td>0001</td></tr>
    					<tr align="center" bgcolor="#FFFFFF" height="20"><td>0003</td><td>保定分行</td>
    						<td>分行</td><td>保定市</td><td>0313800010001</td><td>0001</td></tr>
    				</table>
    			</td></tr>
    			<tr style="vertical-align: top">
    				<td>
    					<table>
    						<tr height="28px">
			    				<td><s:label value="Excel文件：" for="impdept"></s:label></td>
    							<td><input id="impdept" name="impdept" style="width:480px;height:20px"
			    					class="text_field_css" type="file"></input></td>
    							<td colspan="2" align="center">
            						<button id="save" class="buttons_css" style="width:70px">
            							<label style="70px" class="save_css">保存</label></button>
			            			<label style="width:1px"></label>
            						<button id="cancel" class="buttons_css" style="width:70px">
            							<label style="70px" class="cancel_css">返回</label></button>
			    				</td>
    						</tr>
			    			<tr>
    						</tr>
			    		</table>
			    	</td>
    			</tr>
    			<tr><td><table title="未成功导入的数据" singleSelect="true" fitColumns="true" 
    				style="background-color:white;width:700px;height:240px" id="impresult" fit="false">
    				<thead><tr><th field="line" width="60">数据行号</th>
    				<th field="rawdata" width="440">原始数据</th>
    				<th field="errmsg" width="200">错误信息</th></tr></thead>
    				</table></td></tr>
    		</table>
    	</s:form>
    </div>
    </body>
</html>